package com.itheima.ydd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.ydd.entity.Cate;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface CateMapper extends BaseMapper<Cate> {
      @Select("select ydd_cate.id,ydd_cate.catename,count(*) as num from ydd_article,ydd_cate where ydd_article.cateid = ydd_cate.id group by ydd_article.cateid")
      List<Cate> getList();
}




